package com.test.config;

import com.test.utils.SequenceIdGenerator;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class AppConfig {

    /**
     * Long类型时间序列趋势递增的ID生成器
     * 分布式情况下datacenterId+workerId不能重复
     */
    @Bean
    public SequenceIdGenerator sequenceIdGenerator() {
        SequenceIdGenerator sequenceIdGenerator = new SequenceIdGenerator(1, 1);
        return sequenceIdGenerator;
    }


}
